"use strict";
var path = require('path');
var webpack = require('webpack');
var htmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    /* 输入文件 */
    entry: './src/index3.js',
    output: {
        /* 输出目录，没有则新建 */
        path: path.join(__dirname, 'dist'),
        /* 文件名 */
        filename: 'build.js'
    },
    module: {
        rules: [
            {
                test:/\.css$/,
                loader:'style-loader!css-loader!autoprefixer-loader'
            },
            {
                test:/\.less$/,
                loader:'style-loader!css-loader!autoprefixer-loader!less-loader'
            },
            {
                test:/\.(jpg|png|svg|ttf|woff|woff2|gif|eot)$/,
                loader:'url-loader',
                options:{
                    limit:4096,
                    name:'[name].[ext]'
                }
            },
            {
                test: /\.js?$/,
                exclude: /(node_modules|bower_components)/,
                loader: 'babel-loader',
                options:{
                    presets:['react','es2015'],
                    plugins:['transform-runtime']
                },
            }
        ]
    }
    ,
    plugins:[
        new htmlWebpackPlugin({
            template:'./index.html'
        })
    ]
}
